package com.shisfish.library.Utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class CommonUtils{
	
	// 中文转化成首字母
	public static String toChineseLetter(String str) {
		Pattern p = Pattern.compile("[\u4e00-\u9fa5]");
        Matcher m = p.matcher(str);
        String string = "";
        while (m.find()) {
        	string += NameToLetterUtils.convert(m.group());
		}
        string += "," + NameToSpelling.getSpelling(str);
        return string;
	}
	
	public static void main(String[] args) {
		String str = "ll中间lll 将";
		String s = toChineseLetter(str);
		System.out.println(s);
	}
	
}
